package com.bwie.controller;
import com.bwie.domain.Bo;
import com.bwie.domain.Plan;
import com.bwie.domain.User;
import com.bwie.service.UserService;
import com.bwie.service.impl.UserServiceImpl;
import com.bwie.utils.R;
import com.bwie.vo.LoginVo;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* (t_user)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/user/index")
public class UserController {
/**
* 服务对象
*/
    @Autowired
    private UserService userService;

    /**
     * @author: ❤
     * @description:
     * @params: 登录
     * @return: com.bwie.utils.R
     * @date: 2025/10/22 9:48
     */
    @PostMapping("login")
    public R login(@RequestBody LoginVo loginVo){
        return userService.login(loginVo);
    }

    @PostMapping("/getBoList")
    public R getBoList(){
        return userService.getBoList();
    }

    @PostMapping("/getPlanList")
    public R getPlanList(){
        return userService.getPlanList();
    }

    @PostMapping("/addPlan")
    public  R addPlan(@RequestBody @Validated Plan plan){
        return userService.addPlan(plan);
    }

}
